package dao

// Article 制作库
type Article struct {
	Id      int64  `gorm:"primaryKey,autoIncrement" bson:"id,omitempty"`
	Title   string `gorm:"type:varchar(1024)" bson:"title,omitempty"`
	Content string `gorm:"type:blob" bson:"content,omitempty"`
	Status  uint8  `gorm:"type:int(8);comment '1:未发布 2:已发布 3:私有'" bson:"status,omitempty"`
	//索引:AuthorId和Ctime
	AuthorId int64 `gorm:"index:aid_ctime" bson:"author_id,omitempty"`
	Ctime    int64 `gorm:"index:aid_ctime" bson:"ctime,omitempty"`
	Utime    int64 `bson:"utime,omitempty"`
}

// 另一表：已发表
type PublishedArticle Article

func (PublishedArticle) TableName() string {
	return "published_article"
}
func (Article) TableName() string {
	return "article"
}
